home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Macintosh Programmer’s Workshop / MPW 3.1 / MPW / Interfaces / CIncludes / Graf3D.h < prev    next >
Text File  |  1990-12-13  |  2KB  |  96 lines

  1. /************************************************************
  2.  
  3. Created: Tuesday, September 12, 1989 at 7:00 PM
  4.     Graf3D.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.    1985-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __GRAF3D__
  15. #define __GRAF3D__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. typedef Fixed XfMatrix[4][4];
  22.  
  23.  
  24. struct Point3D {
  25.     Fixed x;
  26.     Fixed y;
  27.     Fixed z;
  28. };
  29.  
  30. typedef struct Point3D Point3D;
  31. struct Point2D {
  32.     Fixed x;
  33.     Fixed y;
  34. };
  35.  
  36. typedef struct Point2D Point2D;
  37. struct Port3D {
  38.     GrafPtr grPort;
  39.     Rect viewRect;
  40.     Fixed xLeft;
  41.     Fixed yTop;
  42.     Fixed xRight;
  43.     Fixed yBottom;
  44.     Point3D pen;
  45.     Point3D penPrime;
  46.     Point3D eye;
  47.     Fixed hSize;
  48.     Fixed vSize;
  49.     Fixed hCenter;
  50.     Fixed vCenter;
  51.     Fixed xCotan;
  52.     Fixed yCotan;
  53.     char filler;
  54.     char ident;
  55.     XfMatrix xForm;
  56. };
  57.  
  58. typedef struct Port3D Port3D;
  59. typedef Port3D *Port3DPtr, **Port3DHandle;
  60.  
  61. #ifdef __cplusplus
  62. extern "C" {
  63. #endif
  64. pascal void InitGrf3d(Port3DHandle port);
  65. pascal void Open3DPort(Port3DPtr port); 
  66. pascal void SetPort3D(Port3DPtr port);
  67. pascal void GetPort3D(Port3DPtr *port); 
  68. pascal void MoveTo2D(Fixed x,Fixed y);
  69. pascal void MoveTo3D(Fixed x,Fixed y,Fixed z);
  70. pascal void LineTo2D(Fixed x,Fixed y);
  71. pascal void Move2D(Fixed dx,Fixed dy);
  72. pascal void Move3D(Fixed dx,Fixed dy,Fixed dz); 
  73. pascal void Line2D(Fixed dx,Fixed dy);
  74. pascal void Line3D(Fixed dx,Fixed dy,Fixed dz); 
  75. pascal void ViewPort(const Rect *r);
  76. pascal void LookAt(Fixed left,Fixed top,Fixed right,Fixed bottom);
  77. pascal void ViewAngle(Fixed angle); 
  78. pascal void Identity(void); 
  79. pascal void Scale(Fixed xFactor,Fixed yFactor,Fixed zFactor);
  80. pascal void Translate(Fixed dx,Fixed dy,Fixed dz);
  81. pascal void Pitch(Fixed xAngle);
  82. pascal void Yaw(Fixed yAngle);
  83. pascal void Roll(Fixed zAngle); 
  84. pascal void Skew(Fixed zAngle); 
  85. pascal void Transform(const Point3D *src,Point3D *dst); 
  86. pascal short Clip3D(const Point3D *src1,const Point3D *src2,Point *dst1,
  87.     Point *dst2);
  88. pascal void SetPt3D(Point3D *pt3D,Fixed x,Fixed y,Fixed z); 
  89. pascal void SetPt2D(Point2D *pt2D,Fixed x,Fixed y); 
  90. pascal void LineTo3D(Fixed x,Fixed y,Fixed z);
  91. #ifdef __cplusplus
  92. }
  93. #endif
  94.  
  95. #endif
  96.